﻿using System;
using System.Data;
using System.Collections.Generic;
using CaiBaby.DAL;
using CaiBaby.Entity;

namespace CaiBaby.Service
{
    public class AccountManger
    {
        private readonly Account account = new Account();

        /// <summary>
        /// 增加一条账单记录
        /// </summary>
        /// <param name="accountInfo">账单实体类</param>
        /// <returns>返回账单记录ID</returns>
        public int Add(AccountInfo accountInfo)
        {
            return account.Add(accountInfo);
        }

        /// <summary>
        /// 放入回收站/恢复账单通过账单记录ID
        /// </summary>
        /// <param name="aId">账单记录ID</param>
        /// <param name="state">状态修改 0恢复 1删除</param>
        /// <returns>返回是否成功</returns>
        public bool DelOrReAccountByID(int aId, int state)
        {
            return account.DelOrReAccountByID(aId, state);
        }

        /// <summary>
        /// 账单记录审核不通过
        /// </summary>
        /// <param name="aIdlist">ID集合 例：1,2,3,4</param>
        /// <returns>返回是否成功</returns>
        public bool FailAccountByIDList(string aIdlist)
        {
            return account.FailAccountByIDList(aIdlist);
        }

        /// <summary>
        /// 账单记录通过审核
        /// </summary>
        /// <param name="aIdlist">ID集合 例：1,2,3,4</param>
        /// <returns>返回是否成功</returns>
        public bool PassAccountByIDList(string aIdlist)
        {
            return account.PassAccountByIDList(aIdlist);
        }
    }
}
